<?php

namespace Biz\Services\Site;

use Biz\Constants\ModuleConstants;
use Illuminate\Database\Eloquent\Model;

/**
 * SiteMenuContentService.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SiteMenuModuleService
{
    /**
     * Services.
     *
     * @var mixed
     */
    protected $pageService;

    /**
     * RepositoryController constructor.
     */
    public function __construct(SitePageService $pageService)
    {
        $this->pageService              = $pageService;
    }

    /**
     * 获取菜单连接的单个目标对象
     *
     * @param string $module
     * @param string $target_id
     *
     * @return Model
     */
    public function getTarget(string $module, string $target_id): Model
    {
        switch ($module) {
            case ModuleConstants::MODULE_PAGE:
                return $this->pageService->findByUid($target_id);
                break;
        }
    }
}
